/*

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

*/
module derelict.physfs.api;

alias ubyte PHYSFS_uint8;
alias byte PHYSFS_sint8;
alias ushort PHYSFS_uint16;
alias short PHYSFS_sint16;
alias uint PHYSFS_uint32;
alias int PHYSFS_sint32;
alias ulong PHYSFS_uint64;
alias long PHYSFS_sint64;

struct PHYSFS_File {
    void* opaque;
}

struct PHYSFS_ArchiveInfo {
    const( char )* extension;
    const( char )* description;
    const( char )* author;
    const( char )* url;
}

struct PHYSFS_Version {
    PHYSFS_uint8 major;
    PHYSFS_uint8 minor;
    PHYSFS_uint8 patch;
}

enum ubyte PHYSFS_VERSION_MAJOR = 2;
enum ubyte PHYSFS_VERSION_MINOR = 0;
enum ubyte PHYSFS_VERSION_PATCH = 3;

void PHYSFS_VERSION( ref PHYSFS_Version* x ) {
    x.major = PHYSFS_VERSION_MAJOR;
    x.minor = PHYSFS_VERSION_MINOR;
    x.patch = PHYSFS_VERSION_PATCH;
}

struct PHYSFS_Allocator {
    int function() Init;
    void function() Deinit;
    void* function( PHYSFS_uint64 ) Malloc;
    void* function( void*, PHYSFS_uint64 ) Realloc;
    void function( void* ) Free;
}

extern( C ) nothrow {
    alias void function( void*, const( char )* ) PHYSFS_StringCallback;
    alias void function( void*, const( char )*, const( char )* ) PHYSFS_EnumFilesCallback;
}

extern( C ) nothrow {
    alias void function( PHYSFS_Version* ) da_PHYSFS_getLinkedVersion;
    alias int function( const( char )* ) da_PHYSFS_init;
    alias int function() da_PHYSFS_deinit;
    alias const( PHYSFS_ArchiveInfo* )* da_PHYSFS_supportedArchiveTypes;
    alias void function( void* ) da_PHYSFS_freeList;
    alias const( char )* function() da_PHYSFS_getLastError;
    alias const( char )* function() da_PHYSFS_getDirSeparator;
    alias void function( int ) da_PHYSFS_permitSymbolicLinks;
    alias char** function() da_PHYSFS_getCdRomDirs;
    alias const( char )* function() da_PHYSFS_getBaseDir;
    alias const( char )* function() da_PHYSFS_getUserDir;
    alias const( char )* function() da_PHYSFS_getWriteDir;
    alias int function( const( char )* ) da_PHYSFS_setWriteDir;
    alias int function( const( char )*, int ) da_PHYSFS_addToSearchPath;
    alias int function( const( char )* ) da_PHYSFS_removeFromSearchPath;
    alias char** function() da_PHYSFS_getSearchPath;
    alias int function( const( char )*, const( char )*, const( char )*, int, int ) da_PHYSFS_setSaneConfig;
    alias int function( const( char )* ) da_PHYSFS_mkdir;
    alias int function( const( char )* ) da_PHYSFS_delete;
    alias const( char )* function( const(char)* ) da_PHYSFS_getRealDir;
    alias char** function( const( char )* ) da_PHYSFS_enumerateFiles;
    alias int function( const( char )* ) da_PHYSFS_exists;
    alias int function( const( char )* ) da_PHYSFS_isDirectory;
    alias int function( const( char )* ) da_PHYSFS_isSymbolicLink;
    alias PHYSFS_sint64 function( const( char )* ) da_PHYSFS_getLastModTime;
    alias PHYSFS_File* function( const( char )* ) da_PHYSFS_openWrite;
    alias PHYSFS_File* function( const( char )* ) da_PHYSFS_openAppend;
    alias PHYSFS_File* function( const( char )* ) da_PHYSFS_openRead;
    alias int function( PHYSFS_File* ) da_PHYSFS_close;
    alias PHYSFS_sint64 function( PHYSFS_File*, void*, PHYSFS_uint32, PHYSFS_uint32 ) da_PHYSFS_read;
    alias PHYSFS_sint64 function( PHYSFS_File*, const( void )*, PHYSFS_uint32, PHYSFS_uint32 ) da_PHYSFS_write;
    alias int function( PHYSFS_File* ) da_PHYSFS_eof;
    alias PHYSFS_sint64 function( PHYSFS_File* ) da_PHYSFS_tell;
    alias int function( PHYSFS_File*, PHYSFS_uint64 ) da_PHYSFS_seek;
    alias PHYSFS_sint64 function( PHYSFS_File* ) da_PHYSFS_fileLength;
    alias int function( PHYSFS_File*, PHYSFS_uint64 ) da_PHYSFS_setBuffer;
    alias int function( PHYSFS_File* ) da_PHYSFS_flush;
    alias PHYSFS_sint16 function( PHYSFS_sint16 ) da_PHYSFS_swapSLE16;
    alias PHYSFS_uint16 function( PHYSFS_uint16 ) da_PHYSFS_swapULE16;
    alias PHYSFS_sint32 function( PHYSFS_sint32 ) da_PHYSFS_swapSLE32;
    alias PHYSFS_uint32 function( PHYSFS_uint32 ) da_PHYSFS_swapULE32;
    alias PHYSFS_sint64 function( PHYSFS_sint64 ) da_PHYSFS_swapSLE64;
    alias PHYSFS_uint64 function( PHYSFS_uint64 ) da_PHYSFS_swapULE64;
    alias PHYSFS_sint16 function( PHYSFS_sint16 ) da_PHYSFS_swapSBE16;
    alias PHYSFS_uint16 function( PHYSFS_uint16 ) da_PHYSFS_swapUBE16;
    alias PHYSFS_sint32 function( PHYSFS_sint32 ) da_PHYSFS_swapSBE32;
    alias PHYSFS_uint32 function( PHYSFS_uint32 ) da_PHYSFS_swapUBE32;
    alias PHYSFS_sint64 function( PHYSFS_sint64 ) da_PHYSFS_swapSBE64;
    alias PHYSFS_sint64 function( PHYSFS_uint64 ) da_PHYSFS_swapUBE64;
    alias int function( PHYSFS_File*, PHYSFS_sint16* ) da_PHYSFS_readSLE16;
    alias int function( PHYSFS_File*, PHYSFS_uint16* ) da_PHYSFS_readULE16;
    alias int function( PHYSFS_File*, PHYSFS_sint32* ) da_PHYSFS_readSLE32;
    alias int function( PHYSFS_File*, PHYSFS_uint32* ) da_PHYSFS_readULE32;
    alias int function( PHYSFS_File*, PHYSFS_sint64* ) da_PHYSFS_readSLE64;
    alias int function( PHYSFS_File*, PHYSFS_uint64* ) da_PHYSFS_readULE64;
    alias int function( PHYSFS_File*, PHYSFS_sint16* ) da_PHYSFS_readSBE16;
    alias int function( PHYSFS_File*, PHYSFS_uint16* ) da_PHYSFS_readUBE16;
    alias int function( PHYSFS_File*, PHYSFS_sint32* ) da_PHYSFS_readSBE32;
    alias int function( PHYSFS_File*, PHYSFS_uint32* ) da_PHYSFS_readUBE32;
    alias int function( PHYSFS_File*, PHYSFS_sint64* ) da_PHYSFS_readSBE64;
    alias int function( PHYSFS_File*, PHYSFS_uint64* ) da_PHYSFS_readUBE64;
    alias int function( PHYSFS_File*, PHYSFS_sint16 ) da_PHYSFS_writeSLE16;
    alias int function( PHYSFS_File*, PHYSFS_uint16 ) da_PHYSFS_writeULE16;
    alias int function( PHYSFS_File*, PHYSFS_sint32 ) da_PHYSFS_writeSLE32;
    alias int function( PHYSFS_File*, PHYSFS_uint32 ) da_PHYSFS_writeULE32;
    alias int function( PHYSFS_File*, PHYSFS_sint64 ) da_PHYSFS_writeSLE64;
    alias int function( PHYSFS_File*, PHYSFS_uint64 ) da_PHYSFS_writeULE64;
    alias int function( PHYSFS_File*, PHYSFS_sint16 ) da_PHYSFS_writeSBE16;
    alias int function( PHYSFS_File*, PHYSFS_uint16 ) da_PHYSFS_writeUBE16;
    alias int function( PHYSFS_File*, PHYSFS_sint32 ) da_PHYSFS_writeSBE32;
    alias int function( PHYSFS_File*, PHYSFS_uint32 ) da_PHYSFS_writeUBE32;
    alias int function( PHYSFS_File*, PHYSFS_sint64 ) da_PHYSFS_writeSBE64;
    alias int function( PHYSFS_File*, PHYSFS_uint64 ) da_PHYSFS_writeUBE64;
    alias int function() da_PHYSFS_isInit;
    alias int function() da_PHYSFS_symbolicLinksPermitted;
    alias int function( const( PHYSFS_Allocator )* ) da_PHYSFS_setAllocator;
    alias int function( const( char )*, const( char )*, int ) da_PHYSFS_mount;
    alias const( char )* function( const( char )* ) da_PHYSFS_getMountPoint;
    alias void function( PHYSFS_StringCallback, void* ) da_PHYSFS_getCdRomDirsCallback;
    alias void function( PHYSFS_StringCallback, void* ) da_PHYSFS_getSearchPathCallback;
    alias void function( const( char )*, PHYSFS_EnumFilesCallback, void* ) da_PHYSFS_enumerateFilesCallback;
    alias void function( const( PHYSFS_uint32 )*, char*, PHYSFS_uint64 ) da_PHYSFS_utf8FromUcs4;
    alias void function( const( char )*, PHYSFS_uint32*, PHYSFS_uint64 ) da_PHYSFS_utf8ToUcs4;
    alias void function( const( PHYSFS_uint16 )*, char*, PHYSFS_uint64 ) da_PHYSFS_utf8FromUcs2;
    alias void function( const( char )*, PHYSFS_uint16*, PHYSFS_uint64 ) da_PHYSFS_utf8ToUcs2;
    alias void function( const( char )*, char*, PHYSFS_uint64 ) da_PHYSFS_utf8FromLatin1;
}

__gshared {
    da_PHYSFS_getLinkedVersion PHYSFS_getLinkedVersion;
    da_PHYSFS_init PHYSFS_init;
    da_PHYSFS_deinit PHYSFS_deinit;
    da_PHYSFS_supportedArchiveTypes PHYSFS_supportedArchiveTypes;
    da_PHYSFS_freeList PHYSFS_freeList;
    da_PHYSFS_getLastError PHYSFS_getLastError;
    da_PHYSFS_getDirSeparator PHYSFS_getDirSeparator;
    da_PHYSFS_permitSymbolicLinks PHYSFS_permitSymbolicLinks;
    da_PHYSFS_getCdRomDirs PHYSFS_getCdRomDirs;
    da_PHYSFS_getBaseDir PHYSFS_getBaseDir;
    da_PHYSFS_getUserDir PHYSFS_getUserDir;
    da_PHYSFS_getWriteDir PHYSFS_getWriteDir;
    da_PHYSFS_setWriteDir PHYSFS_setWriteDir;
    da_PHYSFS_addToSearchPath PHYSFS_addToSearchPath;
    da_PHYSFS_removeFromSearchPath PHYSFS_removeFromSearchPath;
    da_PHYSFS_getSearchPath PHYSFS_getSearchPath;
    da_PHYSFS_setSaneConfig PHYSFS_setSaneConfig;
    da_PHYSFS_mkdir PHYSFS_mkdir;
    da_PHYSFS_delete PHYSFS_delete;
    da_PHYSFS_getRealDir PHYSFS_getRealDir;
    da_PHYSFS_enumerateFiles PHYSFS_enumerateFiles;
    da_PHYSFS_exists PHYSFS_exists;
    da_PHYSFS_isDirectory PHYSFS_isDirectory;
    da_PHYSFS_isSymbolicLink PHYSFS_isSymbolicLink;
    da_PHYSFS_getLastModTime PHYSFS_getLastModTime;
    da_PHYSFS_openWrite PHYSFS_openWrite;
    da_PHYSFS_openAppend PHYSFS_openAppend;
    da_PHYSFS_openRead PHYSFS_openRead;
    da_PHYSFS_close PHYSFS_close;
    da_PHYSFS_read PHYSFS_read;
    da_PHYSFS_write PHYSFS_write;
    da_PHYSFS_eof PHYSFS_eof;
    da_PHYSFS_tell PHYSFS_tell;
    da_PHYSFS_seek PHYSFS_seek;
    da_PHYSFS_fileLength PHYSFS_fileLength;
    da_PHYSFS_setBuffer PHYSFS_setBuffer;
    da_PHYSFS_flush PHYSFS_flush;
    da_PHYSFS_swapSLE16 PHYSFS_swapSLE16;
    da_PHYSFS_swapULE16 PHYSFS_swapULE16;
    da_PHYSFS_swapSLE32 PHYSFS_swapSLE32;
    da_PHYSFS_swapULE32 PHYSFS_swapULE32;
    da_PHYSFS_swapSLE64 PHYSFS_swapSLE64;
    da_PHYSFS_swapULE64 PHYSFS_swapULE64;
    da_PHYSFS_swapSBE16 PHYSFS_swapSBE16;
    da_PHYSFS_swapUBE16 PHYSFS_swapUBE16;
    da_PHYSFS_swapSBE32 PHYSFS_swapSBE32;
    da_PHYSFS_swapUBE32 PHYSFS_swapUBE32;
    da_PHYSFS_swapSBE64 PHYSFS_swapSBE64;
    da_PHYSFS_swapUBE64 PHYSFS_swapUBE64;
    da_PHYSFS_readSLE16 PHYSFS_readSLE16;
    da_PHYSFS_readULE16 PHYSFS_readULE16;
    da_PHYSFS_readSLE32 PHYSFS_readSLE32;
    da_PHYSFS_readULE32 PHYSFS_readULE32;
    da_PHYSFS_readSLE64 PHYSFS_readSLE64;
    da_PHYSFS_readULE64 PHYSFS_readULE64;
    da_PHYSFS_readSBE16 PHYSFS_readSBE16;
    da_PHYSFS_readUBE16 PHYSFS_readUBE16;
    da_PHYSFS_readSBE32 PHYSFS_readSBE32;
    da_PHYSFS_readUBE32 PHYSFS_readUBE32;
    da_PHYSFS_readSBE64 PHYSFS_readSBE64;
    da_PHYSFS_readUBE64 PHYSFS_readUBE64;
    da_PHYSFS_writeSLE16 PHYSFS_writeSLE16;
    da_PHYSFS_writeULE16 PHYSFS_writeULE16;
    da_PHYSFS_writeSLE32 PHYSFS_writeSLE32;
    da_PHYSFS_writeULE32 PHYSFS_writeULE32;
    da_PHYSFS_writeSLE64 PHYSFS_writeSLE64;
    da_PHYSFS_writeULE64 PHYSFS_writeULE64;
    da_PHYSFS_writeSBE16 PHYSFS_writeSBE16;
    da_PHYSFS_writeUBE16 PHYSFS_writeUBE16;
    da_PHYSFS_writeSBE32 PHYSFS_writeSBE32;
    da_PHYSFS_writeUBE32 PHYSFS_writeUBE32;
    da_PHYSFS_writeSBE64 PHYSFS_writeSBE64;
    da_PHYSFS_writeUBE64 PHYSFS_writeUBE64;
    da_PHYSFS_isInit PHYSFS_isInit;
    da_PHYSFS_symbolicLinksPermitted PHYSFS_symbolicLinksPermitted;
    da_PHYSFS_setAllocator PHYSFS_setAllocator;
    da_PHYSFS_mount PHYSFS_mount;
    da_PHYSFS_getMountPoint PHYSFS_getMountPoint;
    da_PHYSFS_getCdRomDirsCallback PHYSFS_getCdRomDirsCallback;
    da_PHYSFS_getSearchPathCallback PHYSFS_getSearchPathCallback;
    da_PHYSFS_enumerateFilesCallback PHYSFS_enumerateFilesCallback;
    da_PHYSFS_utf8FromUcs4 PHYSFS_utf8FromUcs4;
    da_PHYSFS_utf8ToUcs4 PHYSFS_utf8ToUcs4;
    da_PHYSFS_utf8FromUcs2 PHYSFS_utf8FromUcs2;
    da_PHYSFS_utf8ToUcs2 PHYSFS_utf8ToUcs2;
    da_PHYSFS_utf8FromLatin1 PHYSFS_utf8FromLatin1;
}